//
// Created by ASUS on 2023/5/11.
//
#include<iostream>

using namespace std;

int main() {
    int a, b;
    cin >> a;
    int arr[a];
    int i;
    for (i = 0; i < a; i++)
    {
        cin >> arr[i];
    }
    int j = 0, k = 0;
    for (j = 0; j < a; j++) {
        for (k = j + 1; k < a; k++)
        {
            if (arr[j] > arr[k])
            {
                cout << "unsorted";
                b = 0;
                break;
            }
            else
                b = 1;



        }
        if (b == 0)
            break;
    }
    int g, f;
    for (g = a; g > 0; g--) {
        for (f = g - 1; f > 0; f--)
        {
            if (arr[g] > arr[f])
            {
                cout << "unsigned";
                b = 0;
                break;
            }
            else
                b = 1;

        } if (b == 0)
            break;
    }
    if (b == 1)
        cout << "sorted";
}